package com.rd.student.dashuju.wangbo.exercise0728;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

public class TestInPutStream {

    public static void main(String[] args) throws Exception{
        File file = new File("stream.txt");
//        根据文件获得输入流
        InputStream is = new FileInputStream(file);
        byte[] by = new byte[(int) file.length()];
        is.read(by);

        String content = new String(by);
        System.out.println(content);
        is.close();
    }
}
